module.exports = app => {
    const { STRING, INTEGER, TEXT, DOUBLE, DATE } = app.Sequelize;
    const Content = app.model.define('contents', {
        id: { type: INTEGER, primaryKey: true, autoIncrement: true },
        title: STRING(255),
        cover: STRING(255),
        price: DOUBLE,
        conetnt: TEXT,
        stock: INTEGER,
        sell_state: {
            type: INTEGER,
            defaultValue: 1
        }, //1正常 0 下架
        self_state: {
            type: INTEGER,
            defaultValue: 1
        }, //1正常 0 删除
        created_at: DATE,
        updated_at: DATE,
    }, {
        charset: 'utf8',
        collate: 'utf8_unicode_ci'
    });
    return Content;
};